package com.qf.day12;

import java.util.LinkedList;
import java.util.List;

public class TextEditorServiceImpl implements TextEditorService {
    private LinkedList<String> textList = new LinkedList<>();

    @Override
    public boolean addLine(String line) {
        return textList.add(line);
    }

    @Override
    public List<String> getALl() {
        return textList;
    }

    @Override
    public boolean updateLine(int lineNum, String line) {
        textList.set(lineNum,line);
        return true;
    }

    @Override
    public boolean deleteLine(int lineNum) {
        textList.remove(lineNum);
        return true;
    }

    @Override
    public boolean insertLine(int lineNum, String line) {
        textList.add(lineNum,line);
        return true;
    }
}
